package com.hakim.wfb.customer.enums;

/**
 * 开售标识
 * Created by caochong on 2016/6/13.
 */
public enum DamageStatusEnum {
    YES("Y", "已损坏"),
    NO("N", "未损坏")
    ;

    private String code;

    private String message;

    private DamageStatusEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


    public static DamageStatusEnum getByCode(String code) {
        if (code != null) {
            DamageStatusEnum[] codes = values();
            for (DamageStatusEnum each : codes) {
                if (each.code.equals(code)) {
                    return each;
                }
            }
        }
        return null;
    }
}
